<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddWgColumnToMapNationalIndustrialParkTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('map_national_industrial_park', function (Blueprint $table) {
            $table->unsignedInteger('status')->default(0)->after('id')->comment('状态');
            $table->unsignedInteger('shopNum')->default(0)->after('id')->comment('已入驻门店数量');
            $table->string('wgNumber', 12)->default('')->after('id')->comment('网规编号');
            $table->unsignedTinyInteger('grade')->default(0)->after('wgNumber')->comment('网规等级');

            $table->index('wgNumber', 'idx_wgNumber');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('map_national_industrial_park', function (Blueprint $table) {
            $table->dropColumn('wgNumber');
            $table->dropColumn('shopNum');
            $table->dropColumn('status');
            $table->dropColumn('grade');
        });
    }
}
